package com.xiaoshuidi.cloud.module.rooms.mapper;

import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.roomel.vo.RoomelCreateReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TestEsDataMapper extends BaseMapperX<RoomelCreateReqVO> {

    @Select(" select  a.id,a.room_house_id roomHouseId ,a.floor_id floorId, a.apartment_id apartmentId , d.is_concentrated isConcentrated ,d.latitude lat ,d.longitude lon ,d.source_type sourceType" +
            " ,d.city city  ,d.district district ,d.block block  ,d.address address  ,d.area residence  ,a.bedroom_num bedroomNum ,a.livingroom_num livingroomNum " +
            " ,a.kitchen_num kitchenNum ,a.toilet_num toiletNum ,a.toward facetoType , b.rent_status rentStatus ,d.is_whole isWhole ,IFNULL(a.space,0) space ,IFNULL(a.price,0) price  " +
            "  ,IFNULL(a.decoration,'') decoration ,c.num floorNo,d.floor_num floorSum " +
            "  ,'' as tenantinfo,'' as houseState " +
            " from room a,room_house b,floor c,apartment d " +
            " where a.room_house_id = b.id and a.floor_id = c.id and a.apartment_id = d.id " +
            " ")
    List<RoomelCreateReqVO> selectEsData();
}
